package org.jeecg.modules.gzgl01.service.impl;

import org.jeecg.modules.gzgl01.entity.FxyConcact;
import org.jeecg.modules.gzgl01.entity.FxyConcact01;
import org.jeecg.modules.gzgl01.entity.FxyConcact02;
import org.jeecg.modules.gzgl01.mapper.FxyConcact01Mapper;
import org.jeecg.modules.gzgl01.mapper.FxyConcact02Mapper;
import org.jeecg.modules.gzgl01.mapper.FxyConcactMapper;
import org.jeecg.modules.gzgl01.service.IFxyConcactService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 合同
 * @Author: zhaodui
 * @Date:   2020-03-10
 * @Version: V1.0
 */
@Service
public class FxyConcactServiceImpl extends ServiceImpl<FxyConcactMapper, FxyConcact> implements IFxyConcactService {

	@Autowired
	private FxyConcactMapper fxyConcactMapper;
	@Autowired
	private FxyConcact01Mapper fxyConcact01Mapper;
	@Autowired
	private FxyConcact02Mapper fxyConcact02Mapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		fxyConcact01Mapper.deleteByMainId(id);
		fxyConcact02Mapper.deleteByMainId(id);
		fxyConcactMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			fxyConcact01Mapper.deleteByMainId(id.toString());
			fxyConcact02Mapper.deleteByMainId(id.toString());
			fxyConcactMapper.deleteById(id);
		}
	}
	
}
